import java.util.*;

class Node {
    int val;
    Node next;
    Node random;

    public Node(int val) {
        this.val = val;
        this.next = null;
        this.random = null;
    }
}

public class Main {

    public Node copyRandomList(Node head) {
        if(head == null) return null;

        Map<Node,Node> map = new HashMap<>();
        Node cur = head;
        while(cur != null) {
            Node node = new Node(cur.val);
            map.put(cur,node);
            cur = cur.next;
        }

        cur = head;
        while(cur != null) {
            map.get(cur).next = map.get(cur.next);
            map.get(cur).random = map.get(cur.random);
            cur = cur.next;
        }

        return map.get(head);
    }
    public int singleNumber(int[] nums) {
        Set<Integer> set = new HashSet<>();

        for(int i = 0; i < nums.length; i++) {
            if(!set.contains(nums[i])) {
                set.add(nums[i]);
            }else {
                set.remove(nums[i]);
            }
        }

        for(int i = 0; i < nums.length; i++) {
            if(set.contains(nums[i])) {
                return nums[i];
            }
        }
        return -1;
    }

    public int numJewelsInStones(String jewels, String stones) {
        Set<Character> set = new HashSet<>();

        for(int i = 0;i < jewels.length();i++) {
            char ch = jewels.charAt(i);
            set.add(ch);
        }

        int count = 0;
        for(int i = 0; i < stones.length();i++) {
            char ch = stones.charAt(i);
            if(set.contains(ch)) {
                count++;
            }
        }

        return count;
    }

    
        public static void fun(String s1, String s2) {
            Set<Character> set = new HashSet<>();
            s2 = s2.toUpperCase();
            for(int i = 0; i < s2.length(); i++) {
                char ch  = s2.charAt(i);
                set.add(ch);
            }

            Set<Character> set1 = new HashSet<>();
            s1 = s1.toUpperCase();
            for(int i = 0;i < s1.length();i++) {
                char ch = s1.charAt(i);
                if(!set.contains(ch) && !set1.contains(ch)) {
                    set1.add(ch);
                    System.out.print(ch+"");
                }
            }
        }

        public static void main1(String[] args) {
            Scanner scan = new Scanner(System.in);
            String str1 = scan.nextLine();
            String str2 = scan.nextLine();
            fun(str1,str2);
        }

}
